package com.qk.mapper;

import com.qk.dto.CourseDto;
import com.qk.entity.Course;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface CourseMapper {
    List<Course> selectCourse(CourseDto courseDto);
    @Delete("delete from course where id=#{id}")
    void deleteById(Integer id);
    @Insert("insert into course(subject,name,price,target,description,create_time,update_time) values(#{subject},#{name},#{price},#{target},#{description},#{createTime},#{updateTime})")
    void add(Course course);
    @Select("select * from course where id=#{id}")
    Course selectId(Integer id);

    void updataCourse(Course course);
    @Select("select * from course")
    List<Course> selectAll();
@Select("select * from course where subject=#{subject}")
    List<Course> selcetSubject(Integer subject);
}


